package com.github.cakin.shiro.chapter19.entity;

import java.io.Serializable;

/**
 * @className: UrlFilter
 * @description: UrlFilter 实体
 * @date: 2020/5/28
 * @author: cakin
 */
public class UrlFilter implements Serializable {
    /**
     * 主键
     */
    private Long id;
    /**
     * url名称/描述
     */
    private String name;
    /**
     * 地址
     */
    private String url;
    /**
     * 所需要的角色，可省略
     */
    private String roles;
    /**
     * 所需要的权限，可省略
     */
    private String permissions;

    public Long getId() {
        return id;
    }

    public void setId( Long id ) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName( String name ) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl( String url ) {
        this.url = url;
    }

    public String getRoles() {
        return roles;
    }

    public void setRoles( String roles ) {
        this.roles = roles;
    }

    public String getPermissions() {
        return permissions;
    }

    public void setPermissions( String permissions ) {
        this.permissions = permissions;
    }

    @Override
    public boolean equals( Object o ) {
        if (this == o) {
            return false;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        UrlFilter urlFilter = (UrlFilter) o;

        if (id != null ? !id.equals(urlFilter.id) : urlFilter.id != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "UrlFilter{"
                + "id=" + id
                + ", name='" + name + '\''
                + ", url='" + url + '\''
                + ", roles='" + roles + '\''
                + ", permissions='" + permissions + '\''
                + '}';
    }
}
